home *** CD-ROM | disk | FTP | other *** search
/ QRZ! Ham Radio 4 / QRZ Ham Radio Callsign Database - Volume 4.iso / files / dsp / 56ktools / a5611.tz / a5611 / examples / caltone.a56 next >
Text File  |  1992-08-11  |  1KB  |  96 lines

  1. ; Output a calibration tone using table lookup and interpolation.
  2. ; written by Quinn Jensen (jensenq@npd.novell.com)
  3. ; ref: _Digital Sine-Wave Synthesis Using the DSP56001_,
  4. ;    Motorola app note APR1/D rev 1
  5. ;
  6.  
  7. include 'tdsg.basic.a56'
  8.  
  9. ;***************************************************************
  10. ;
  11. ;    sample rate computations
  12. ;
  13. ;***************************************************************
  14.  
  15. dot
  16.     org    x:$20
  17.  
  18. include    'caltone.inc'
  19.  
  20. dphase    dc    dphase_h
  21.     org    y:$20
  22.     dc    dphase_l
  23.     org    x:$21
  24. phase    dc    0
  25. sinetab    equ    $100
  26.  
  27.     org    p:dot
  28. ;
  29. ; non-interrupt code
  30. ;
  31.  
  32. hf_init
  33.     ori    #4,omr
  34.     rts
  35.  
  36. eff1_on
  37. eff1_off
  38. eff2_on
  39. eff2_off
  40. eff3_on
  41. eff3_off
  42. eff4_on
  43. eff4_off
  44.     rts
  45.  
  46. ;
  47. ; fs = 32.552083 kHz
  48. ;
  49.  
  50. hf_comp
  51.     jsr    <saveregs
  52.  
  53. #if 0
  54.     move        x:<in_l,a
  55.     move        a,x:<out_l
  56.     move        x:<in_r,a
  57.     move        a,x:<out_r
  58. #endif
  59.  
  60.     move        l:<phase,a
  61.     move        l:<dphase,y
  62.     move        y0,b
  63.     lsr    b
  64.     move        b1,x1        ;x1 = frac
  65.     add    y,a
  66.     move        #>$0000FF,y1
  67.     and    y1,a
  68.     move        a,l:<phase
  69.     move        a1,n0
  70.     move        #sinetab,r0
  71.     movec        #$FF,m0
  72.     nop
  73.  
  74.     move        y:(r0+n0),y0
  75.     move        y0,a
  76. #if 0
  77.     macr    -x1,y0,a
  78.     move        (r0)+
  79.     move        y:(r0+n0),y0
  80.     macr    y0,x1,a
  81. #endif
  82.  
  83.     move        a,y0
  84.     move        #ampl,y1
  85.     mpyr    y0,y1,a
  86.  
  87.     move        a,x:<out_l
  88.     move        a,x:<out_r
  89.  
  90. bypass
  91.     jsr    <restregs
  92.     rts
  93.  
  94.     end
  95.